// pages/address/index.js

var app = getApp()
Page({

  data: {
    beijing_url: '/pages/images/beijing.jpg',
    windowHeight: 0,
    kwidth: 0,
  },


  onLoad: function (options) {
    var that = this
    wx.setNavigationBarTitle({
      title: '选择收货地址',
    })
    wx.getSystemInfo({
      success: function (res) {
        that.setData({
          windowHeight: res.windowHeight,
          kwidth: res.windowHeight - 140
        })
      }
    })
    that.setData({
      url: app.globalData._new_url,
      beijing_url: app.globalData.shop_infos.ShopBackgroundImage,
    })
  },
  onShow: function () {
    this.setData({
      url: app.globalData._new_url,
      beijing_url: app.globalData.shop_infos.ShopBackgroundImage,
    })
  },
  toaddadr: function (e) {
    wx.navigateTo({
      url: './address',
    })
  },
  getWechatAddress: function (e) {
    var page = this;
    wx.chooseAddress({
      success: function (e) {
        if (e.errMsg != 'chooseAddress:ok')
          return;
        wx.showLoading();
        console.log(e)
        wx.setStorageSync('WxAddress', e)
        wx.navigateBack()
      }, complete
      : function () { wx.hideLoading() }
    });
  },

})